﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TSCC.Interface;

namespace TSCC.WinControl
{
    public partial class ucLblCbo : ControlMatrix //UserControl
    {
        [Category("TSCC")]
        [Description("設定顯示文字")]
        public string Caption
        {
            set
            {
                ucLabel1.Caption = value;
            }
            get
            {
                return ucLabel1.Caption;
            }
        }

        public ucLblCbo()
        {
            InitializeComponent();
            this.accessControl = comboBox1;
        }

        public void AddItem(iCMBItem p_item)
        {
            comboBox1.Items.Add(p_item);
        }

        public void SetData(List<iCMBItem> p_list)
        {
            foreach (iCMBItem itm in p_list)
            {
                this.AddItem(itm);
            }
        }

        public iCMBItem GetSelectItem()
        {
            return comboBox1.SelectedItem as iCMBItem;
        }

        public override void SetValue(object p_value)
        {
            base.SetValue(p_value);
        }   
    }
}
